﻿using Anke.SHManage.BLL;
using Anke.SHManage.MSSQLDAL;
using Anke.SHManage.Utility;
using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Anke.SHManage.Web.Reports
{
    public partial class LS_CardInfoModeWebForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitPage();
            }
        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            BindReportDataSource();

        }
        private void InitPage()
        {          
            BindReportDataSource();
        }

        protected void BindReportDataSource()
        {
            string centerID = (this.centerID.Text).ToString();
            string stationID = (this.stationID.Text).ToString();
            string cardCode = (this.cardCode.Text).ToString();
            string driverWorkID = (this.driverWorkID.Text).ToString();
            string driverName = (this.driverName.Text).ToString();
            string isActive = (this.HiddenForIsActive.Value).ToString();
            string isFanBan = (this.HiddenForIsFanBan.Value).ToString();
   
            this.ReportViewer1.LocalReport.DataSources.Clear();
            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/LS_YKJCXX.rdlc");
           
            LSDAL dal = new LSDAL();
            DataTable dt = dal.Get_LS_YKJCXX(centerID, stationID, cardCode, driverWorkID, driverName, isActive, isFanBan);

            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_YKJCXX", dt));
            this.ReportViewer1.LocalReport.Refresh();
        }
    }
}